﻿using AllIsWell.Tests.TestData;
using NUnit.Framework;

namespace AllIsWell.Web.Tests.Controllers.PageControllerTests
{
    [TestFixture]
    public class CreatePage : PageControllerTest
    {
        [Test]
        public void ShouldReturnCreatePageView()
        {
            var createPageView = PageController.CreatePage(1);

            Assert.IsNotNull(createPageView);
            Assert.AreEqual(string.Empty, createPageView.ViewName);
        }

        [Test]
        public void ShouldPassPageModelToTheView()
        {
            var expectedPage = PageSeed.GetPage();
            PageServiceMock.Setup(service => service.GetFreshPage(1)).Returns(expectedPage);

            var createPageView = PageController.CreatePage(1);

            Assert.IsNotNull(createPageView.Model);
            Assert.AreEqual(expectedPage, createPageView.Model);
        }
    }
}